package com.tianji.medical.controller;


import com.tianji.common.Result;
import com.tianji.common.utils.SecurityUtil;
import com.tianji.medical.pojo.dto.AppointmentRegistrationDto;
import com.tianji.medical.service.DoctorScheduleService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 医生号源表 前端控制器
 * </p>
 *
 * @author 陈佳
 * @since 2024-10-14
 */
@RestController
@RequestMapping("/doctor-schedule")
@RequiredArgsConstructor
public class DoctorScheduleController {

    private final DoctorScheduleService doctorScheduleService;

    @ApiOperation(value = "预约挂号功能实现")
    @PostMapping("/appointmentRegistration")
    public Result appointmentRegistration(@RequestBody AppointmentRegistrationDto dto) {
        Long userId = SecurityUtil.getUser().getUserId();
        dto.setPatientId(userId);
        return doctorScheduleService.appointmentRegistration(dto);
    }
}

